<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<base th:href="@{/}">
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <title>全部订单</title>

    <!-- Favicons -->
    <link rel="shortcut icon" th:href="@{assets/images/Shop.ico}">
    <link rel="stylesheet" th:href="@{assets/css/vendor/vendor.min.css}">
    <link rel="stylesheet" th:href="@{assets/css/plugins/plugins.min.css}">
    <link rel="stylesheet" th:href="@{assets/css/style.min.css}">


</head>

<body>

<div th:include="head :: headname"></div>


<!-- Breadcrumb Section Start -->
<div class="section">

    <!-- Breadcrumb Area Start -->
    <div class="breadcrumb-area bg-primary">
        <div class="container">
            <div class="breadcrumb-content">
                <ul>
                    <li>
                        <a th:href="@{/goods/index}"><i class="fa fa-home"></i> </a>
                    </li>
                    <li class="active">全部订单</li>
                </ul>
            </div>
        </div>
    </div>
    <!-- Breadcrumb Area End -->

</div>
<!-- Breadcrumb Section End -->

<!-- Shopping Cart Section Start -->
<div class="section section-margin">
    <div class="container">

        <div class="row">
            <div class="col-lg-3" th:fragment="leafname">
                <!-- Sidebar Widget Start -->
                <aside class="sidebar_widget mt-10 mt-lg-0">
                    <div class="widget_inner">
                        <div class="widget-list mb-10">
                            <h3 class="widget-title mb-6">订单中心</h3>
                            <!-- Widget Menu Start -->
                            <nav>
                                <ul class="category-menu mb-n3">
                                    <li class="menu-item-has-children pb-4"><a th:href="@{order/allOrder}">全部订单 </a></li>
                                    <li class="menu-item-has-children pb-4"><a th:href="@{order/obligation}">待付款 </a></li>
                                    <li class="menu-item-has-children pb-4"><a th:href="@{order/received}">待收货 </a></li>
                                    <li class="menu-item-has-children pb-4"><a th:href="@{order/allcomment}">已评论 </a></li>
                                </ul>
                            </nav>
                            <!-- Widget Menu End -->
                        </div>
                        <!--<div class="widget-list mb-10">
                            <h3 class="widget-title mb-6">用户中心</h3>
                            <ul class="category-menu mb-n3">
                                <li class="menu-item-has-children pb-4">
                                    <a th:href="@{/user/personal/{id}(id=${userInfo.id})}" style="color: rgb(0, 196, 204)">个人信息
                                        <i class="fa fa-angle-left"></i></a></li>
                                <li class="menu-item-has-children pb-4">
                                    <a th:href="@{/user/accountSafe/{id}(id=${userInfo.id})}">账号安全
                                        <i class="fa fa-angle-right"></i></a></li>
                                <li class="menu-item-has-children pb-4"><a href="#">我的收藏
                                    <i class="fa fa-angle-right"></i></a></li>
                                <li class="menu-item-has-children pb-4">
                                    <a th:href="@{/user/addressBook/{id}(id=${userInfo.id})}">地址管理
                                        <i class="fa fa-angle-right"></i></a></li>
                                <li class="menu-item-has-children pb-4"><a href="#">优惠券
                                    <i class="fa fa-angle-right"></i></a></li>
                                <li class="menu-item-has-children pb-4"><a href="#">积分商城
                                    <i class="fa fa-angle-right"></i></a></li>
                            </ul>
                        </div>-->
                        <div class="widget-list">
                            <h3 class="widget-title mb-6">猜你喜欢</h3>

                            <div class="sidebar-body product-list-wrapper mb-n6">

                                <!-- Single Product List Start -->
                                <div class="single-product-list mb-6" th:each="re:${session.get('sList')}">
                                    <!-- Product List Thumb Start -->
                                    <div class="product">
                                        <div class="thumb">
                                            <a href="single-product.html" class="image">
                                                <img class="fit-image first-image" th:src="${re.pic}"
                                                     alt="Product Image">
                                                <!--                                    <img class="fit-image second-image"-->
                                                <!--                                         src="assets/images/products/small-product/10.jpg" alt="Product Image">-->
                                            </a>
                                        </div>
                                    </div>
                                    <!-- Product List Thumb End -->

                                    <!-- Product List Content Start -->
                                    <div class="product-list-content">
                                        <h6 class="product-name">
                                            <a href="single-product.html" th:text="${re.name}"></a>
                                        </h6>
                                        <span class="price">
                                                    <span class="new" th:text="'￥'+${re.promotionPrice}">$12.50</span>
                                            <span class="old" th:text="'￥'+${re.price}"></span>
                                            </span>
                                    </div>
                                    <!-- Product List Content End -->

                                </div>
                                <!-- Single Product List End -->



                            </div>
                        </div>
                    </div>
                </aside>
                <!-- Sidebar Widget End -->
            </div>

            <div class=" col-lg-9">
                <!-- Cart Table Start -->
                <div class="cart-table table-responsive">
                    <table class="table table-bordered">

                        <!-- Table Head Start -->
                        <thead>
                        <th colspan="3">
                                <span><select th:onchange="received1()" class="received1"
                                              style="outline: none;border: none;background-color: rgb(0,196,204);text-align: center">
                                    <option th:if="${t0} eq 0" selected value="0">近3个月订单</option>
                                    <option th:if="${t0} ne 0" value="0">近3个月订单</option>
                                    <option th:if="${t1} eq 1" selected value="1">今年内</option>
                                    <option th:if="${t1} ne 1" value="1">今年内</option>
                                    <option th:if="${t2} eq 2" selected value="2">全部订单</option>
                                    <option th:if="${t2} ne 2" value="2">全部订单</option>
                                </select></span>
                            &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;<span>订单详情</span>
                        </th>
                        <th class="pro-thumbnail" id="">收货人</th>
                        <th class="pro-price">金额</th>
                        <th class="pro-quantity">
                            <select style="outline: none;border: none;background-color: rgb(0,196,204);text-align: center">
                                <option>待收货</option>
                            </select>
                        </th>
                        <th class="pro-subtotal">操作</th>
                        </tr>


                        </thead>
                        <tbody th:each="a : ${list}">
                        <tr>
                            <td colspan="7" style="height: 1px;border: none"></td>
                        </tr>
                        <tr style="background-color: rgb(0,196,204);">
                            <td colspan="7" style="text-align: left;color: white">
                                &emsp;时间：<span
                                    th:text="${#dates.format(a.getCreateTime(),'yyyy-MM-dd HH:mm:ss')}"></span>&emsp;&emsp;订单单号：<span
                                    th:text="${a.getOrderSn()}"></span>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="3" class="pro-thumbnail">
                        <tr th:each="om,m : ${a.omsOrderItems}">
                            <td colspan="3" class="pro-thumbnail">
                                <div style="float: left;width: 100px;color: rgb(156,85,123)"><a href="#"><img
                                        th:src="${om.getProductPic()}"
                                        alt="Product" width="60"/></a></div>
                                <div style="color: rgb(156,85,123);width: 390px;"><a href="#" style="width: 200px"><span
                                        th:text="${om.getProductName()}"
                                        style="white-space: normal;word-wrap: break-word;width: 300px;color: rgb(156,85,123)"></span></a>
                                    <p>数量：<span th:text="${om.getProductQuantity()}"></span></p>
                                </div>
                            </td>
                            </td>
                            <td th:if="${m.first}" th:attr="rowspan=${m.size}"><a th:text="${a.receiverName}" href="#"
                                                                                  style="padding: 5px 10px 5px 10px;color: red;border: 1px solid red"></a>
                            </td>
                            <td th:if="${m.first}" th:attr="rowspan=${m.size}" class="pro-price"
                                th:text="${a.payAmount}"></td>
                            <td th:if="${m.first}" th:attr="rowspan=${m.size}" class="pro-quantity"
                                th:text="${a.status}==2?'待收货':''"></td>
                            <td th:if="${m.first}" th:attr="rowspan=${m.size}" class="pro-subtotal">
                                <p><a th:href="@{/order/confirmReceiptAll(id=${a.id})}"
                                      style="padding: 5px 10px 5px 10px;color: red;border: 1px solid red">确认收货</a>
                                </p>
                                <p><a th:href="@{/order/goBackOrder(id=${a.id})}"
                                      style="padding: 5px 10px 5px 10px;color: red;border: 1px solid red">申请退货</a>
                                </p>
                            </td>
                        </tr>
                        </tbody>
                        <!-- Table Body End -->
                    </table>


                </div>

                <div class="row">
                    <div class="col-12">
                        <!--shop toolbar start-->
                        <div class="toolbar_wrapper mt-8 border-top pt-8">

                            <!-- Shopt Top Bar Right Start -->
                            <div class="blog-top-bar-right d-flex justify-content-center">
                                <nav>
                                    <ul class="pagination">
                                        <li class="page-item disabled upPage">
                                            <a class="page-link rounded-0" href="#" aria-label="Previous"
                                               style="border: 1px solid rgb(0,196,204)">
                                                <span aria-hidden="true">上一页</span>
                                            </a>
                                        </li>
                                        <li>
                                            <a class="page-link active" href="#"
                                               style="border: 1px solid rgb(0,196,204);border-left: none">...</a>
                                        </li>
                                        <li class="pageNum">
                                            <a class="page-link active pageNum" href="#"
                                               style="border: 1px solid rgb(0,196,204);border-left: none">1</a>
                                        </li>
                                        <li>
                                            <a class="page-link active" href="#"
                                               style="border: 1px solid rgb(0,196,204);border-left: none">...</a>
                                        </li>
                                        <li class="page-item">
                                            <a class="page-link rounded-0 nextPage" href="#" aria-label="Next"
                                               style="border: 1px solid rgb(0,196,204)">
                                                <span aria-hidden="true">下一页</span>
                                            </a>
                                        </li>
                                    </ul>
                                </nav>
                            </div>
                            <!-- Shopt Top Bar Right End -->

                        </div>
                        <!--shop toolbar end-->

                    </div>
                </div>
            </div>
        </div>


    </div>

</div>
</div>
<!-- Shopping Cart Section End -->

<!-- Footer Section Start -->
<div th:replace="footer :: footerS"></div>
<!-- Footer Section End -->


<!-- Mobile Menu Start -->
<div class="mobile-menu-wrapper">
    <div class="offcanvas-overlay"></div>

    <!-- Mobile Menu Inner Start -->
    <div class="mobile-menu-inner">

        <!-- Button Close Start -->
        <div class="offcanvas-btn-close">
            <i class="pe-7s-close"></i>
        </div>
        <!-- Button Close End -->

        <!-- Mobile Menu Inner Wrapper Start -->
        <div class="mobile-menu-inner-wrapper">
            <!-- Mobile Menu Search Box Start -->
            <div class="search-box-offcanvas">
                <form>
                    <input class="search-input-offcanvas" type="text" placeholder="Search product...">
                    <button class="search-btn"><i class="pe-7s-search"></i></button>
                </form>
            </div>
            <!-- Mobile Menu Search Box End -->

            <!-- Mobile Menu Start -->
            <div class="mobile-navigation">
                <nav>
                    <ul class="mobile-menu">
                        <li class="has-children">
                            <a href="#">Home <i class="fa fa-angle-down"></i></a>
                            <ul class="dropdown">
                                <li><a href="index.html">Home One</a></li>
                                <li><a href="index-2.html">Home Two</a></li>
                                <li><a href="index-3.html">Home Three</a></li>
                            </ul>
                        </li>
                        <li class="has-children">
                            <a href="#">Shop <i class="fa fa-angle-down" aria-hidden="true"></i></a>
                            <ul class="dropdown">
                                <li><a href="shop.html">Shop Grid</a></li>
                                <li><a href="shop-left-sidebar.html">Shop Left Sidebar</a></li>
                                <li><a href="shop-right-sidebar.html">Shop Right Sidebar</a></li>
                                <li><a href="shop-list-fullwidth.html">Shop List Fullwidth</a></li>
                                <li><a href="shop-list-left-sidebar.html">Shop List Left Sidebar</a></li>
                                <li><a href="shop-list-right-sidebar.html">Shop List Right Sidebar</a></li>
                                <li><a href="wishlist.html">Wishlist</a></li>
                                <li><a href="cart.html">Shopping Cart</a></li>
                                <li><a href="checkout.html">Checkout</a></li>
                                <li><a href="compare.html">Compare</a></li>
                            </ul>
                        </li>
                        <li class="has-children">
                            <a href="#">Product <i class="fa fa-angle-down" aria-hidden="true"></i></a>
                            <ul class="dropdown">
                                <li><a href="single-product.html">Single Product</a></li>
                                <li><a href="single-product-sale.html">Single Product Sale</a></li>
                                <li><a href="single-product-group.html">Single Product Group</a></li>
                                <li><a href="single-product-normal.html">Single Product Normal</a></li>
                                <li><a href="single-product-affiliate.html">Single Product Affiliate</a></li>
                                <li><a href="single-product-slider.html">Single Product Slider</a></li>
                                <li><a href="single-product-gallery-left.html">Gallery Left</a></li>
                                <li><a href="single-product-gallery-right.html">Gallery Right</a></li>
                                <li><a href="single-product-tab-style-left.html">Tab Style Left</a></li>
                                <li><a href="single-product-tab-style-right.html">Tab Style Right</a></li>
                                <li><a href="single-product-sticky-left.html">Sticky Left</a></li>
                                <li><a href="single-product-sticky-right.html">Sticky Right</a></li>
                            </ul>
                        </li>
                        <li class="has-children">
                            <a href="#">Pages <i class="fa fa-angle-down" aria-hidden="true"></i></a>
                            <ul class="dropdown">
                                <li><a href="about.html">About Us</a></li>
                                <li><a href="contact.html">Contact</a></li>
                                <li><a href="faq.html">Faq</a></li>
                                <li><a href="error-404.html">Error 404</a></li>
                                <li><a href="my-account.html">My Account</a></li>
                                <li><a href="login.html">Loging | Register</a></li>
                            </ul>
                        </li>
                        <li class="has-children">
                            <a href="#">Blog <i class="fa fa-angle-down" aria-hidden="true"></i></a>
                            <ul class="dropdown">
                                <li><a href="blog.html">Blog</a></li>
                                <li><a href="blog-left-sidebar.html">Blog Left Sidebar</a></li>
                                <li><a href="blog-right-sidebar.html">Blog Right Sidebar</a></li>
                                <li><a href="blog-details.html">Blog Details</a></li>
                                <li><a href="blog-details-sidebar.html">Blog Details Sidebar</a></li>
                            </ul>
                        </li>
                        <li><a href="about.html">About</a></li>
                        <li><a href="contact.html">Contact</a></li>
                    </ul>
                </nav>
            </div>
            <!-- Mobile Menu End -->

            <!-- Language, Currency & Link Start -->
            <div class="offcanvas-lag-curr mb-6">
                <div class="header-top-lan-curr-link">
                    <div class="header-top-lan dropdown">
                        <h4 class="title">Language:</h4>
                        <button class="dropdown-toggle" data-bs-toggle="dropdown">English <i
                                class="fa fa-angle-down"></i></button>
                        <ul class="dropdown-menu dropdown-menu-right">
                            <li><a class="dropdown-item" href="#">English</a></li>
                            <li><a class="dropdown-item" href="#">Japanese</a></li>
                            <li><a class="dropdown-item" href="#">Arabic</a></li>
                            <li><a class="dropdown-item" href="#">Romanian</a></li>
                        </ul>
                    </div>
                    <div class="header-top-curr dropdown">
                        <h4 class="title">Currency:</h4>
                        <button class="dropdown-toggle" data-bs-toggle="dropdown">USD <i class="fa fa-angle-down"></i>
                        </button>
                        <ul class="dropdown-menu dropdown-menu-right">
                            <li><a class="dropdown-item" href="#">USD</a></li>
                            <li><a class="dropdown-item" href="#">Pound</a></li>
                        </ul>
                    </div>
                </div>
            </div>
            <!-- Language, Currency & Link End -->

            <!-- Contact Links/Social Links Start -->
            <div class="mt-auto bottom-0">

                <!-- Contact Links Start -->
                <ul class="contact-links">
                    <li><i class="fa fa-phone"></i><a href="#"> +012 3456 789</a></li>
                    <li><i class="fa fa-envelope-o"></i><a href="#"> info@example.com</a></li>
                    <li><i class="fa fa-clock-o"></i> <span>Monday - Sunday 9.00 - 18.00</span></li>
                </ul>
                <!-- Contact Links End -->

                <!-- Social Widget Start -->
                <div class="widget-social">
                    <a title="Facebook" href="#"><i class="fa fa-facebook-f"></i></a>
                    <a title="Twitter" href="#"><i class="fa fa-twitter"></i></a>
                    <a title="Linkedin" href="#"><i class="fa fa-linkedin"></i></a>
                    <a title="Youtube" href="#"><i class="fa fa-youtube"></i></a>
                    <a title="Vimeo" href="#"><i class="fa fa-vimeo"></i></a>
                </div>
                <!-- Social Widget Ende -->
            </div>
            <!-- Contact Links/Social Links End -->
        </div>
        <!-- Mobile Menu Inner Wrapper End -->

    </div>
</div>


<script th:src="@{assets/js/vendor.min.js}"></script>
<script th:src="@{assets/js/plugins.min.js}"></script>

<!--Main JS-->
<script th:src="@{assets/js/main.js}"></script>
<script>
    $(function () {
        select()
    })

    $('#check-all').click(function () {
        $('.check-one').prop('checked', this.checked);
    })

    function select() {
        let total = $('.check-one').length
        $('.check-one').change(function () {
            let count = $('.check-one:checked').length
            if (count == total) {
                $('#check-all').prop('checked', true)
            } else {
                $('#check-all').prop('checked', false)
            }
        })
    }


</script>
</body>
<script>
    function received1() {
        location.href = '/order/ReceivedAdd?t=' + $('.received1').val();
    }
</script>
<script>
    $(function () {
        $.ajax({
            url: '/order/allOrderList',
            type: "get",
            success: function (rel) {
                console.info(rel)
            }
        })
    })

</script>
</html>